import request from '@/config/axios'

// 节假日安排 VO
export interface HolidayScheduleVO {
  id: number // 序号
  title: string // 标题
  years: number // 年份
  startDate: Date // 开始日期
  endDate: Date // 结束日期
  workType: string // 工作类型
  remark: string // 备注
}

// 节假日安排 API
export const HolidayScheduleApi = {
  // 查询节假日安排分页
  getHolidaySchedulePage: async (params: any) => {
    return await request.get({ url: `/oa/holiday-schedule/page`, params })
  },

  // 查询节假日安排详情
  getHolidaySchedule: async (id: number) => {
    return await request.get({ url: `/oa/holiday-schedule/get?id=` + id })
  },

  // 新增节假日安排
  createHolidaySchedule: async (data: HolidayScheduleVO) => {
    return await request.post({ url: `/oa/holiday-schedule/create`, data })
  },

  // 修改节假日安排
  updateHolidaySchedule: async (data: HolidayScheduleVO) => {
    return await request.put({ url: `/oa/holiday-schedule/update`, data })
  },

  // 删除节假日安排
  deleteHolidaySchedule: async (id: number) => {
    return await request.delete({ url: `/oa/holiday-schedule/delete?id=` + id })
  },

  // 导出节假日安排 Excel
  exportHolidaySchedule: async (params) => {
    return await request.download({ url: `/oa/holiday-schedule/export-excel`, params })
  },
}